package com.ruoyi.app.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppScenicSpotMapper;
import com.ruoyi.app.domain.AppScenicSpot;
import com.ruoyi.app.service.IAppScenicSpotService;

/**
 * 景点Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class AppScenicSpotServiceImpl implements IAppScenicSpotService 
{
    @Autowired
    private AppScenicSpotMapper appScenicSpotMapper;

    /**
     * 查询景点
     * 
     * @param spotId 景点主键
     * @return 景点
     */
    @Override
    public AppScenicSpot selectAppScenicSpotBySpotId(Long spotId)
    {
        return appScenicSpotMapper.selectAppScenicSpotBySpotId(spotId);
    }

    /**
     * 查询景点列表
     * 
     * @param appScenicSpot 景点
     * @return 景点
     */
    @Override
    public List<AppScenicSpot> selectAppScenicSpotList(AppScenicSpot appScenicSpot)
    {
        return appScenicSpotMapper.selectAppScenicSpotList(appScenicSpot);
    }

    /**
     * 新增景点
     * 
     * @param appScenicSpot 景点
     * @return 结果
     */
    @Override
    public int insertAppScenicSpot(AppScenicSpot appScenicSpot)
    {
        appScenicSpot.setCreateTime(DateUtils.getNowDate());
        return appScenicSpotMapper.insertAppScenicSpot(appScenicSpot);
    }

    /**
     * 修改景点
     * 
     * @param appScenicSpot 景点
     * @return 结果
     */
    @Override
    public int updateAppScenicSpot(AppScenicSpot appScenicSpot)
    {
        appScenicSpot.setUpdateTime(DateUtils.getNowDate());
        return appScenicSpotMapper.updateAppScenicSpot(appScenicSpot);
    }

    /**
     * 批量删除景点
     * 
     * @param spotIds 需要删除的景点主键
     * @return 结果
     */
    @Override
    public int deleteAppScenicSpotBySpotIds(Long[] spotIds)
    {
        return appScenicSpotMapper.deleteAppScenicSpotBySpotIds(spotIds);
    }

    /**
     * 删除景点信息
     * 
     * @param spotId 景点主键
     * @return 结果
     */
    @Override
    public int deleteAppScenicSpotBySpotId(Long spotId)
    {
        return appScenicSpotMapper.deleteAppScenicSpotBySpotId(spotId);
    }
}
